<hmtl>
	<head>
		<title>Turn-o-matic</title>
		<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
		 charset=UTF-8">
		<style>
		* {font-family:Arial;font-size:12px;}
			body {
				background:#f9f9f9;
				
			}
			#base{
				margin:0 auto;
				width:800px;
			}
			table {
			
			}
			
			.tda{
				background:white;
			}
			.tdb{
				background:#eee;
			}
			td{
				text-align:center;

				color:#333;
			}
			tr{

			}
			h1{
				font-size:18px;
			}
			th{
				background:#4b4b4b;
				color:white;
				padding:5px;
			}
		</style>
	</head>
	<body>
		<br><br>
		<div id="base">
			<h1>TURN-O-MATIC</h1>
			Hores reservades: Totes | Avui | Demà <br><br>
			
<?

include "../php/mysql.php";
$link = new mysqlconn;
$link = $link->conectar();


$query = mysql_query("SELECT *, DATE_FORMAT(data,'%d/%m/%y') as data, TIME_FORMAT(hora,'%H:%i') as hora FROM reservas",$link);
echo '<center><table cellpadding="5" cellspacing="0" width="800"><tr><th>DNI</th><th>Data</th><th>Hora</th></tr>';
$i = 1;
while ($row = mysql_fetch_array($query)){
	echo "<tr class='td";
	if ($i % 2 == 0) echo "a'>";
		else echo "b'>";
	echo "<td>".$row['dni']."</td><td>".$row['data']."</td><td>".$row['hora']."</td></tr>";
	$i++;
}
echo '</table></center>';

echo "Total: ".mysql_num_rows($query);

?>
		</div>
	</body>
</html>